package cn.mabach.goods.service;

import cn.mabach.DTO.PageUtils;
import cn.mabach.DTO.RS;
import cn.mabach.goods.entity.CategoryEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
/**
 * 商品类目
 *
 * @author chenshun
 * @email 176468159@qq.com
 * @date 2019-12-20 13:30:34
 */
@Api(tags = "品类服务接口")
public interface CategoryService   {


    @GetMapping("/listCategory")
    @ApiOperation(value = "分页查询")
    RS<PageUtils> queryPage(@RequestParam Map<String, Object> params);

    @GetMapping("/infoCategory")
    @ApiOperation(value = "根据id查找")
    RS<CategoryEntity> getByIdE(@RequestParam("id") Integer id);

    @PostMapping("/saveCategory")
    @ApiOperation(value = "保存")
    RS saveE(@RequestBody CategoryEntity entity) throws Exception;

    @PostMapping("/updateCategory")
    @ApiOperation(value = "修改")
    RS updateByIdE(@RequestBody CategoryEntity entity) throws Exception;

    @PostMapping("/deleteCategory")
    @ApiOperation(value = "根据ID集合删除")
    RS removeByIdsE(@RequestBody List<Integer> ids) throws Exception;

    @GetMapping("/findCategoryTree")
    @ApiOperation(value = "查询返回分类树")
    public RS<List<Map>> findCategoryTree();
}

